<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\common\validate;

/**
 * Curr验证器
 */
class Wallet extends ValidateBase
{
    
    // 验证规则
    protected $rule =   [
        'name'          => 'require|unique:wallet',
        'transfer_min'          => '>=:0',
        'transfer_max'          => '>=:0',
        'poundage'          => '>=:0',
        'conversion_available'=>'>=:0',
    ];

    // 验证提示
    protected $message  =   [
        'name.require'          => '钱包名称不能为空',
        'name.unique'          => '钱包名称已存在',
        'transfer_min'         => '转账最高数额不能小于0',
        'transfer_max.'         => '转账最低数额不能小于0',
        'poundage'         => '转账手续费不能小于0',
        'conversion_available'=>'兑换可用钱包比例不能小于0'
    ];

    // 应用场景
    protected $scene = [
        'edit'  =>  ['name','transfer_min','transfer_max','poundage,conversion_available'],
    ];

}
